// pages/opened/opened.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    mails: []
  },

  onLoad: function (options) {
    var self = this;
    wx.request({
      url: app.globalData.baseUrl + 'users/query',
      data: {
        session: wx.getStorageSync("session"),
        isOpen: '1'
      },
      method: "POST",
      success: function (res) {
        console.log(res.data);
        if (res.data.code === '000000') {
          self.setData({
            mails: res.data.body
          });
        }
      }
    })
  },
  openMail: function (event) {
    wx.navigateTo({
      url: '../detail/detail?id=' + event.currentTarget.dataset.id,
    })
  }
})